<?
if (!defined('MODULE_FILE')){
die ("cant access file directly!");
}

@require_once 'class/NewModule.php';
$att1 = new NewModule();
$row11 = $att1->AllList();

?>
<?php require_once 'commonJS.php'; ?>
	<div style="margin-left:20px; margin-top: 10px;">
		<p>
			<a id="active" class="btn btn-outline btn-primary btn-xs" href="modules.php?file=list_modules&mid=<? echo $mid;?>&smid=<? echo $smid;?>" >List All Modules</a>
		</p>
	</div>	
<div class="col-lg-8">
<div class="panel panel-primary">
<div class="panel-heading">Add New Module</div>
<div class="panel-body">	
<div class="table-responsive">			
<form METHOD="POST" action="modules.php?file=module_ins&mid=<? echo $mid; ?>&smid=<? echo $smid; ?>" id="formSubmit" name="formSubmit">
<input type="hidden" id="redid" Name="redid" value="<?php echo $rcdID;?>">
	
<table width="100%">
<tr>
<td>Title</td>
<td> <input type="text" class="validate[required]" name="title" id="title" size="50" value=""></td>
</tr>
<tr><td height="20px;"></td></tr>
<tr>
<td>File Path:</td>
<td> <input type="text" class="validate[required]" name="path" id="path" size="50" value="">
</td>
</tr>
<tr><td height="20px;"></td></tr>
<tr>
<td>Parent:</td>
<td><select  name="parent"  id="parent" class="validate[required]">
<option value="0" size="20">--SELECT--</option>
<?   
	for ($i = 0; $i < count($row11); $i++)
	{ 	
		?>
		<option value="<? echo $row11[$i]['mid']; ?>"><? echo $row11[$i]['title']; ?></option>
		<?
		 $md1 = $row11[$i]['mid'];
		 $row12 = $att1->AllList2($md1);
		for ($j = 0; $j < count($row12); $j++)
		{ 	
		?>
		<option value="<? echo $row12[$j]['mid']; ?>"><? echo "&nbsp&#124;&#151".$row12[$j]['title']; ?></option>
		 
	<?  }?> 
<? 	}?> 
	</select>
</td>
</tr>
<tr><td height="20px;"></td></tr>
<tr>
<td>Rank:</td>
<td> <input type="text" class="validate[required]" name="rank" size="30" id="rank" value=""/>
</td>
</tr>
<tr><td height="20px;"></td></tr>
<tr>
<td></td>
<td><input name="Submit" type="submit" value="Submit"></td>
</tr>
</table>
</form>
</div>
</div>
</div>
</div>